import {COURSE_TYPE} from '@/services/api'
import {request, METHOD} from '@/utils/request'

export async function listCourseTypeByPage(currentPage, size) {
    return request(COURSE_TYPE, METHOD.GET, {
        currentPage: currentPage,
        size: size
    })
}

export async function totalCourseType() {
    return request(COURSE_TYPE+"/total", METHOD.GET)
}

export async function findCourseTypeById(id) {
    return request(COURSE_TYPE+"/one", METHOD.GET, {
        id: id
    })
}

export async function deleteCourseType(id) {
    return request(COURSE_TYPE, METHOD.DELETE, {
        id: id
    })
}

export async function editCourseType(courseType) {
    return request(COURSE_TYPE, METHOD.POST, {
        id: courseType.id,
        name: courseType.name,
        standardNum: courseType.standardNum,
        maxNum: courseType.maxNum
    })
}
